import '@/appBase/global.less';
import Vue from 'vue'
import App from './App'
import { createRouter } from './router/index'
import store from "./store/store.js"
// import Antd from 'ant-design-vue'
import '@/appBase/loadAntd';
// import { Input } from 'ant-design-vue';
// Vue.use(Input)
import moment from 'moment';
//懒加载
import VueLazyload from 'vue-lazyload'
// 预览图片
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
// 上传图片截取图片
import Croppa from 'vue-croppa';
import 'vue-croppa/dist/vue-croppa.css';
import { ZkBtn } from '@/appBase/index';
import { nowTime } from '@zkey-webapp/general';
Vue.use(Viewer)
Vue.use(Croppa);
Vue.component('ZkBtn', ZkBtn);

Viewer.setDefaults({
    Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
})
// 图片懒加载配置
Vue.use(VueLazyload, {
    preLoad: 0.5, // 预加载高度比例
    error: '../public/img/login.gif', // 图片路径错误时加载图片
    loading: '../public/img/loding.gif', // 预加载图片
    attempt: 1, // 尝试加载图片数量
    // set observer to true
    observer: true,
    // optional
    observerOptions: {
        rootMargin: '0px',
        threshold: 0.1
    }
})

Vue.config.errorHandler = function (err, vm, info) {
    // handle error
    // `info` 是 Vue 特定的错误信息，比如错误所在的生命周期钩子
    // 只在 2.2.0+ 可用
    console.log(err);
    console.log(info);
    throw err;
}
new Vue({
    router: createRouter(store),
    store,
    render: h => h(App),
    beforeMount() {
        var that = this;
        // 省市区数据源
        // queryAllRegion().then((result) => { });
    },
    methods: {
    }
}).$mount('#app')
